//
//  GMInputView.h
//  Gmall
//
//  Created by yemeihua on 15/7/14.
//  Copyright (c) 2015年 Gmall. All rights reserved.
//

#import <UIKit/UIKit.h>

///输入类型
typedef NS_ENUM(NSInteger, GMInputViewInputType)
{
    ///键盘
    GMInputViewInputTypeKeyBoard = 0,
    ///录音
    GMInputViewInputTypeVoice = 1,
    ///插件
    GMInputViewInputTypePlugin = 2,
    ///表情
    GMInputViewInputTypeEmoji = 3
};

@class GMInputView;

///聊天输入视图代理
@protocol GMInputViewDelegate <NSObject>

@optional

/**
 *  发送回调
 *
 *  @param inputView 输入视图
 *  @param text      文本
 */
- (void)didInputView:(GMInputView *)inputView sendText:(NSString *)text;

/**
 *  修改frame回调
 *
 *  @param inputView 输入视图
 *  @param frame     frame
 */
- (void)didInputView:(GMInputView *)inputView changeFrame:(CGRect)frame;

/**
 *  点击录音按钮
 *
 *  @param inputView 输入视图
 *  @param button    录音按钮
 *  @param touch     触摸点
 */
- (void)didInputView:(GMInputView *)inputView recodeButton:(UIButton *)button beginTouch:(UITouch *)touch;

/**
 *  点击录音移动按钮
 *
 *  @param inputView 输入视图
 *  @param button    录音按钮
 *  @param touch     触摸点
 */
- (void)didInputView:(GMInputView *)inputView recodeButton:(UIButton *)button moveTouch:(UITouch *)touch;

/**
 *  结束录音回调
 *
 *  @param inputView 输入视图
 *  @param button    按钮
 *  @param touch     触摸点
 */
- (void)didInputView:(GMInputView *)inputView recodeButton:(UIButton *)button endTouch:(UITouch *)touch;

/**
 *  点击插件按钮回调
 *
 *  @param inputView    输入视图
 *  @param pluginButton 插件按钮
 */
- (void)didInputView:(GMInputView *)inputView touchUpInsidePluginButton:(UIButton *)pluginButton;

/**
 *  点击表情按钮回调
 *
 *  @param inputView   输入视图
 *  @param emojiButton 表情按钮
 */
- (void)didInputView:(GMInputView *)inputView touchUpInsideEmojiButton:(UIButton *)emojiButton;

@end

/**
 *  输入视图
 */
@interface GMInputView : UIView

///输入文本框
@property (nonatomic,readonly) UITextView *textView;
///语音.键盘按钮
@property (nonatomic,readonly) UIButton *inputTypeButton;
///插件按钮
@property (nonatomic,readonly) UIButton *pluginButton;
///表情按钮
@property (nonatomic,readonly) UIButton *emojiButton;
///录音按钮
@property (nonatomic,readonly) UIButton *recodeButton;
///当前输入类型
@property (nonatomic) GMInputViewInputType inputType;
///代理
@property (nonatomic,weak) id<GMInputViewDelegate> delegate;

@property (nonatomic) BOOL shouldDismiss;

- (void)reset;

@end
